package com.tedu.account.controller;

import com.tedu.account.pojo.dto.ExpendQuery;
import com.tedu.account.pojo.vo.ExpendVO;
import com.tedu.account.service.ExpendService;
import com.tedu.common.response.JsonResult;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/expend/")
public class ExpendController {
    @Autowired
    private ExpendService expendService;

    @GetMapping("/select")
    public JsonResult select(ExpendQuery expendQuery){
        log.debug("支出查询:{}", expendQuery);
        List<ExpendVO> list =expendService.selectExpend(expendQuery);
        return JsonResult.ok(list);
    }
}
